package upload

import (
	"gin_demo/utility"
	"log"

	"github.com/gin-gonic/gin"
)

var UPload = Upload{}

type Upload struct{}

func (u *Upload) UploadFile(ctx *gin.Context) {
	fileInfo, err := utility.Upload(ctx)
	if err != nil {
		log.Fatalln(err)
		utility.Fail(ctx, err.Error())
	} else {

		utility.Success(ctx, fileInfo)
	}
}
